#define _CRT_SECURE_NO_WARNINGS

#include "Constants.h"
#include "CaseSettings.h"
#include "ModelSettings.h"
#include "Flowfield.h"

#include "WallGeometry.h"
#include "Cphase.h"
#include "Flag.h"
#include "Particle.h"
#include "mathParticleTracking.h"

#include "Slip.h"
#include "Injection.h"
#include "ImpingementParameter.h"
#include "MotionIntegration.h"
#include "PLinearMotion.h"
#include "TimeStepSize.h"

#include "ParticleResultData.h"
#include "ParticleTracking.h"
#include "WallImpingement.h"
#include "WallRebound.h"

using namespace std;

int main()
{
	//////////////////////////////////////////////////////////////////////////////////////
	/*Part 1: preprocessor: constant, case setting, model setting, flowfield buildup    */
	/* the four points of the domain geometry is anti-clockwise direction,              */
	/* the left and bottom dot is the first point(vertex 0)                             */
	/* gas velocity in y direction is zero                                              */
	/* gas velocity in x direction is linear                                            */
	auto constant0 = make_shared<Constants>();
	string caseSetting = "inCaseSettings.txt", inletFile = "inInletFlowSettings.txt";
	auto caseSettings0 = make_shared<CaseSettings>(caseSetting, inletFile);
	string modelSetting = "inModelSettings.txt";
	auto modelSettings0 = make_shared<ModelSettings>(modelSetting);
	auto flowfield0 = make_shared<Flowfield>(modelSettings0, caseSettings0);
	auto wallGeometry0 = make_shared<WallGeometry>(caseSettings0);
	//////////////////////////////////////////////////////////////////////////////////////
	/*Part 2: Particle tracking solver                                                  */
	/*partcle injeciton, initialization, wall-interaction, particle motion integration  */
	auto mainParticleTracking = make_shared<ParticleTracking>(caseSettings0, modelSettings0,
		constant0, flowfield0, wallGeometry0);
	//////////////////////////////////////////////////////////////////////////////////////
	/*Part 3: Postprocessor, write out particle tracking results to a file              */
	ParticleResultData ParticleResultData(mainParticleTracking);
	ParticleResultData.WriteToFile();
	return 1;
}
